#ifndef CARVIS_H
#define CARVIS_H

#include <time.h>
#include <QGraphicsItem>
#include <QObject>
#include <qthread.h>
#include "classes\Automat.hpp"
#include "classes\painThread.h"

class Carvis : public QObject, public QGraphicsItem
{
	Q_OBJECT
public:
	 
	 painThread *watek;
     Carvis(int Car_Id, painThread *watek);
     QRectF boundingRect() const;
     QPainterPath shape() const;
     void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
	 void test();
	 QPoint zwroc_punkt(QPoint currentpos, int Car_Id);
	  
protected:
     void advance(int step);
	 void changed(const QList<QRectF> & region);
	 void przemieszczaj(QPoint nowa_pozycja);
	 
private:
	
	int x,y;
	int CarId;
    qreal angle;
    qreal speed;
    QColor color;
	QPoint position;

public slots:
	 void zrob_ruch(QPoint currentpos, int Car_Id);

signals:
	 void CarPainted();

 };

 #endif